﻿
IF (EXISTS(SELECT id from sysobjects where id=object_id('usp_Login')))
	DROP PROCEDURE [dbo].[usp_Login]
GO

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go




create procedure usp_Login
@VoterId as nvarchar(50),
@Password as nvarchar(50),
@Admin as bit

as

if (@Admin = 1)
select count(0) as LoggedIn from TblVoter where VoterId=@VoterId and Password = @Password
else
select count(0) as LoggedIn from TblVoter where VoterId=@VoterId and Password = @Password and IsAdmin=1




